# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-iostruct
_pkgname=${pkgname#ruby-}
pkgver=0.5.0
pkgrel=1
pkgdesc='A Struct that can read/write itself from/to IO-like objects.'
arch=('any')
url='https://rubygems.org/gems/iostruct'
license=('MIT')
depends=('ruby')
source=("https://rubygems.org/gems/$_pkgname-$pkgver.gem")
noextract=("$_pkgname-$pkgver.gem")
sha512sums=('a0d70575ac7ef7e843d954efa47f3057c425b1dcfd6aa779f7162812e20f40efb6bf0c4875b77bad9a975775a0627559b945b5647b140c51be88c601efeda372')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_pkgname-$pkgver.gem"

  rm "$pkgdir/$_gemdir/cache/$_pkgname-$pkgver.gem"

  find "$pkgdir/$_gemdir/extensions/" -name *.so -delete
}

